import request from "@/utils/request";

export default {
  getList() {
    return request({
      method: "get",
      url: "/members"
    });
  },
  search(page, size, searchMap) {
    return request({
      method: "post",
      url: `/members/search/${page}/${size}`,
      data: searchMap
    });
  },
  addMember(newMemberInfo) {
    return request({
      method: "post",
      url: `/members`,
      data: {
        newMemberInfo
      }
    });
  },
  getById(id) {
    return request({
      method: "get",
      url: `/members/${id}`
    });
  },
  updateMember(editMemberInfo) {
    return request({
      method: "put",
      url: `/members/${editMemberInfo.id}`,
      data: {
        editMemberInfo
      }
    });
  },
  delById(id) {
    return request({
      method: "delete",
      url: `/members/${id}`
    });
  }
};
